<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>填写人员内部调动申请表</title>
</head>
<script src="./myCommonJS/hr_corpMap.js"></script>
<script type="text/javascript"
        src="./oa2hr/inputExtend/staffRedeployment/staffRedeployment.js"></script>
<script type="text/javascript">
    /**
     upDoc.getElementById("my:人员编号").value = '${memberCode}';
     upDoc.getElementById("my:调动人姓名").value = '${name}';
     upDoc.getElementById("my:进入福耀时间").value = '${joinTime}';
     upDoc.getElementById("my:聘用学历").value = '${education}';
     upDoc.getElementById("my:调出单位岗位").value = '${nowPost}';
     upDoc.getElementById("my:调出单位职级").value = '${nowLevel}';
     upDoc.getElementById("my:调出单位车间科室").value = '${dep2}';
     upDoc.getElementById("my:调出单位部门工厂").value = '${dep1}';
     upDoc.getElementById("my:调出制造部").value = '${corp}';
     **/
</script>
<style>
    select {
        width: 220px;
    }

    #memberCode {
        width: 214px;
    }
    .hide{ display: none}
</style>

<body style="font-family: 微软雅黑; font-size: 13px;">
<div id='lodingDiv'
     style='display: none; filter: alpha(opacity =                 30); opacity: 0.3; z-index: 12001; text-align: center; position: absolute; width: 100%; height: 250px; background: url("./oa2uap/img/loding.gif") no-repeat center center #666; left: 0; top: 0;'>
    &nbsp;</div>
<table align="center" border="0" style="margin-top: 20px">
    <tr class="hide">
        <td>调动人员工号：</td>
        <td><input id='memberCode' /></td>
    </tr>
    <tr class="hide">
        <td style="">调入制造部：</td>
        <td style=""><select id="companySelect"
                             onchange="myHandler.onComanySelectValueChange()">
            <option id='msgOption'>请选择</option> ${companyOption}
        </select></td>
    </tr>
    <tr>
        <td valign="top">调入部门：</td>
        <td valign="top"><div>
            <select id="dep1" onchange="myHandler.onDepSelectValueChange(this)">

            </select>
        </div>
            <div>
                <select id="dep2" style="display: none; margin-top: 5px"
                        onchange="myHandler.onDepSelectValueChange(this)"></select>
            </div>
            <div>
                <select id="dep3" style="display: none; margin-top: 5px"
                        onchange="myHandler.onDepSelectValueChange(this)"></select>
            </div>
            <div>
                <select id="dep4" style="display: none; margin-top: 5px"
                        onchange="myHandler.onDepSelectValueChange(this)"></select>
            </div>
    </tr>
    <tr>
        <td>调入岗位：</td>
        <td><select id="postSelect"></select></td>
    </tr>
    <tr>
        <td align="center" valign="middle">&nbsp;</td>
        <td align="right" valign="middle"><input type="button"
                                                 onclick="filltheblank()" value="确定" /></td>
    </tr>
</table>
<script>
    var url = './oa2hrController.do';
    var method = 'staffRedeployment';
    initDept("1002");
    function  initDept(corpID) {
        if (document.getElementById("msgOption")) {
            document.getElementById("companySelect").removeChild(document
                .getElementById("msgOption"));
        }
        clearSelect(depArray[0]);
        clearSelect(depArray[1], true);
        clearSelect(depArray[2], true);
        clearSelect(depArray[3], true);
        clearSelect(postSelectID);
       // var corpID = document.getElementById("companySelect").value;
        var params = "method=" + method + "&operate=1&id=" + corpID;
        _ajax(params, url, function(xmlhttp) {
            text = xmlhttp.responseText;
            if (text == '') {
                alert('获取部门信息异常，请重试或者联系信息部');
            } else {
                var result = eval('(' + text + ')');
                for (var i = 0; i < result.length; i++) {
                    var depNode = eval('(' + result[i] + ')');
                    document.getElementById(depArray[0]).options
                        .add(createOption(depNode.name, depNode.id));
                }

            }
        });

    }


    function filltheblank(){
        setUpFieldValue2(getUpFieldsByFieldval("现工厂车间\t ").eq(0),
            getSelectText(depArray[0]));
        setUpFieldValue2(getUpFieldsByFieldval("现岗位").eq(0),
            getSelectText(postSelectID));
        fy_dialog_close1();

    }
    function fy_dialog_close1() {
        //window.parent.$(".mask").remove();
        window.parent.parent.$(".layui-layer-iframe").parent().find(".layui-layer-close").trigger("click");
    }
</script>
</body>
</html>